<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<!-- 开发环境版本，包含了有帮助的命令行警告 -->
		<script src="https://cdn.jsdelivr.net/npm/vue@2.6/dist/vue.js"></script>
	</head>
	<body>
		<div id="demo">
			<button v-on:click="counter+=1">数值{{counter}}</button>
			<button v-on:dblclick="greet('aaa',$event)">greet</button>
		</div>
		<script type="text/javascript">
			var vm = new Vue({
				el: "#demo",
				data: {
					counter: 0
				},
				methods: {
					greet: function(msg, event) {
						if (event) {
							console.log(event);
						} else {
							alert(msg)
						}
					}
				}
			})
		</script>

	</body>
</html>
